package cn.edu.hpu.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ActionSupport;

import cn.edu.hpu.pojo.Contacts;
import cn.edu.hpu.pojo.Deal;
import cn.edu.hpu.pojo.Task;
import cn.edu.hpu.service.ContactsService;
import cn.edu.hpu.service.DealService;
import cn.edu.hpu.service.TaskService;

public class SearchAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	private ContactsService contactsService;
	private DealService dealService;
	private TaskService taskService;
	private List<Contacts> list1;
	private List<Contacts> list2;
	private List<Task> list3;
	private List<Deal> list4;
	private String cname;
	private String companyname;
	private String tasktitle;
	private String dealtitle;
	@Override
	public String execute() throws Exception {
		return SUCCESS;
	}
	
	public String m1(){
		list1 = contactsService.findByName(cname);
		list2 = contactsService.findByCompanyname(companyname);
		list3 = taskService.findByTitle(tasktitle);
		list4 = dealService.findByTitle(dealtitle);
		return SUCCESS;
	}
	
	
	
	
	
	
	
	
	public String getCname() {
		return cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	public String getCompanyname() {
		return companyname;
	}

	public void setCompanyname(String companyname) {
		this.companyname = companyname;
	}

	public String getTasktitle() {
		return tasktitle;
	}

	public void setTasktitle(String tasktitle) {
		this.tasktitle = tasktitle;
	}

	public String getDealtitle() {
		return dealtitle;
	}

	public void setDealtitle(String dealtitle) {
		this.dealtitle = dealtitle;
	}

	public List<Contacts> getList1() {
		return list1;
	}
	public void setList1(List<Contacts> list1) {
		this.list1 = list1;
	}
	public List<Contacts> getList2() {
		return list2;
	}
	public void setList2(List<Contacts> list2) {
		this.list2 = list2;
	}
	public List<Task> getList3() {
		return list3;
	}
	public void setList3(List<Task> list3) {
		this.list3 = list3;
	}
	public List<Deal> getList4() {
		return list4;
	}
	public void setList4(List<Deal> list4) {
		this.list4 = list4;
	}
	@Autowired
	public void setContactsService(ContactsService contactsService) {
		this.contactsService = contactsService;
	}
	@Autowired
	public void setDealService(DealService dealService) {
		this.dealService = dealService;
	}
	@Autowired
	public void setTaskService(TaskService taskService) {
		this.taskService = taskService;
	}
	
}
